<!DOCTYPE html>
<html>
<head>
  <#assign dicSelect=JspTaglibs["http://www.casic304.cn/dicSelect"] />
  <#assign secSelect=JspTaglibs["http://www.casic304.cn/secSelect"] />
  <#assign fillDept=JspTaglibs["http://www.casic304.cn/fillDept"] />
  <meta charset="utf-8">
  <title>现场问题处理单基本信息</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="${ctx}/layui/css/layui.css" media="all"/>
  <link rel="stylesheet" href="${ctx}/qbdmsStatic/iconfont/iconfont.css"/>
  <link rel="stylesheet" href="${ctx}/qbdmsStatic/style/qbdms.css">
  <script type="text/javascript">
    var __ctx = "${ctx}";
  </script>
  <style>
    .fillBtn{
      background:rgba(38,130,255,1) !important;
    }
  </style>
</head>
<body class="listBody qbdms-particulars">
<#if flag !="1" && flowStatus!="0">
<div id="button" style="padding: 20px">
  <a class="layui-btn layui-btn-sm fillBtn" lay-event="" id="detail">
    <i class="iconfont iconicon_file"></i>
    <span>运行明细</span>
  </a>
  <a class="layui-btn layui-btn-sm flowChart fillBtn" lay-event="flowChart">
    <i class="layui-icon layui-icon-picture-fine"></i>
    <span >流程图</span>
  </a>
  <a class="layui-btn layui-btn-sm fillBtn" lay-event="" id="taskOpinion">
    <i class="iconfont iconicon_compile"></i>
    <span>审批历史</span>
  </a>
</div>
</#if>
<div class="qbdms-bodyDiv">
  <div class="layui-table-view-body qbdms-add-view-body">
    <div class="qbdms-formTitle">现场问题处理单 <#if flag !="1"><i class="qbdms-returnOn closeWindow">返回</i></#if></div>
  <form class="layui-form formPreview" requrl="${ctx}/qbdms/wQbdProblemHandle/get" lay-filter="wQbdProblemHandleDataForm">
    <div class="" style="width: 100%;">
      <table class="tableExcel qbdms-zeroTable" width="100%" border="0" cellspacing="0" cellpadding="0">
        <tbody>
        <tr id="tbxx"></tr>
        <tr>
          <td class="qbdms-zeroTable-lable">密级<span style="color: red;">*</span></td>
          <td ><@secSelect.sec_select data_src=1 required=true name="secret"/></td>
          <td class="qbdms-zeroTable-lable">编号<span style="color: red;">*</span></td>
          <td name="registernum"></td>
          <td class="qbdms-zeroTable-lable">型号<span style="color: red;">*</span></td>
          <td name="model"></td>
        </tr>
        <tr>
          <td class="qbdms-zeroTable-lable">提出时间<span style="color: red;">*</span></td>
          <td name="proposetime"></td>
          <td class="qbdms-zeroTable-lable">提出单位<span style="color: red;">*</span></td>
          <td name="proposedept"></td>
        </tr>
        <tr>
          <td class="qbdms-zeroTable-lable">责任人<span style="color: red;">*</span></td>
          <td name="dutyperson"></td>
          <td class="qbdms-zeroTable-lable">责任单位<span style="color: red;">*</span></td>
          <td name="dutydept"></td>
          <td class="qbdms-zeroTable-lable">流程状态<span style="color: red;">*</span></td>
          <td name="status"></td>
        </tr>
        <tr>
          <td class="qbdms-zeroTable-lable">实施单位</td>
          <td name="impdept"></td>
          <td class="qbdms-zeroTable-lable">产品/试验名称</td>
          <td name="productname"></td>
        </tr>
        <tr>
          <td class="qbdms-zeroTable-lable">设计文件代号</td>
          <td name="doccode"></td>
          <td class="qbdms-zeroTable-lable">文件变更意见</td>
          <td name="changesuggest"></td>
          <td class="qbdms-zeroTable-lable">更改单编号</td>
          <td name="changregnum"></td>
        </tr>
        <tr>
          <td class="qbdms-zeroTable-lable">提出单位代表</td>
          <td name="proposerepresent"></td>
          <td class="qbdms-zeroTable-lable">实施单位代表</td>
          <td name="imprepresent"></td>
        </tr>
        <tr>
          <td class="qbdms-zeroTable-lable">现场处理内容简述</td>
          <td colspan="5" name="problemhandleinfo"></td>
        </tr>
        <tr>
          <td class="qbdms-zeroTable-lable">
            现场问题处理单
          </td>
          <td colspan="5">
            <div class="uploadFileList" fileUploadName="probhandleurl"></div>
          </td>
        </tr>
        <tr>
          <td class="qbdms-zeroTable-lable">措施内容<span style="color: red;">*</span></td>
          <td colspan="5" name="measure"></td>
        </tr>
        <tr>
          <td class="qbdms-zeroTable-lable">计划完成时间</td>
          <td name="plancomplettime"></td>
        </tr>
        <tr>
          <td class="qbdms-zeroTable-lable">落实情况<span style="color: red;">*</span></td>
          <td colspan="5" name="impletstatus"></td>
        </tr>
        <#if flag =="1">
        <tr>
          <td class="qbdms-zeroTable-lable">型号助理员确认</td>
          <td colspan="5">
            <#list taskOpinionNewList as taskOpinionNewList>
            <#if taskOpinionNewList.taskName == "型号助理员确认1">
            <p>${taskOpinionNewList.opinion}</p><br/>
            <p style="text-align:right;">审批人:${taskOpinionNewList.exeFullname}&nbsp&nbsp&nbsp&nbsp
              日期:${(taskOpinionNewList.endTime?string("yyyy-MM-dd"))!}</p>
                </#if>
              </#list>
              <#list taskOpinionNewList as taskOpinionNewList>
              <#if taskOpinionNewList.taskName == "型号助理员确认2">
              <p>${taskOpinionNewList.opinion}</p><br/>
              <p style="text-align:right;">审批人:${taskOpinionNewList.exeFullname}&nbsp&nbsp&nbsp&nbsp
                日期:${(taskOpinionNewList.endTime?string("yyyy-MM-dd"))!}</p>
              </#if>
            </#list>
        </td>
        </tr>
        <tr>
          <td class="qbdms-zeroTable-lable">型号主管副总师</td>
          <td colspan="5">
            <#list taskOpinionNewList as taskOpinionNewList>
            <#if taskOpinionNewList.taskName == "型号主管副总师">
            <p>${taskOpinionNewList.opinion}</p><br/>
            <p style="text-align:right;">审批人:${taskOpinionNewList.exeFullname}&nbsp&nbsp&nbsp&nbsp
              日期:${(taskOpinionNewList.endTime?string("yyyy-MM-dd"))!}</p>
              </#if>
            </#list>
          </td>
        </tr>
        </#if>
        </tbody>
      </table>
      <input name="proposetime" type="hidden" placeholder="未填写" autocomplete="off" class="layui-input dateTimeFiled input-right time-init" format="yyyy-MM-dd" datetype="date" />
      <input name="plancomplettime" type="hidden" placeholder="未填写" autocomplete="off" class="layui-input dateTimeFiled input-right time-init" format="yyyy-MM-dd" datetype="date" />
    </div>
    <#if isClose != 'true' && flag !="1">
    <div class="layui-form-item btnformItem">
      <p>
        <button type="reset" id="closeWindow" class="layui-btn layui-btn-sm btn-save qbdms-oneBtnLine">返回</button>
      </p>
    </div>
  </#if>
  </form>
</div>
</div>
<script src="${ctx}/qbdmsStatic/public/configFile.js"></script>
<script src="${ctx}/layui/layui.js"></script>
<script>
  layui.config({
    base: serverPath.qbdmsPath + staticPath.qbdmsPath //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
  }).use(['index', 'setter', 'layer', 'propsHandle', 'upload', 'common', 'laydate', 'jquery', 'publicMethods', 'qbdmsForm'], function () {
    // -----常量声明----------
    var $ = layui.jquery,
        laydate = layui.laydate,
        setter = layui.setter,  // 配置信息
        layer = layui.layer,
        common = layui.common,
        propsHandle = layui.propsHandle,
        upload = layui.upload,
        publicMethods = layui.publicMethods,
        formId = '' || '',
        form = layui.qbdmsForm;
    $(".subContTem").hide()

    var defProps = {
      //viewMould: 'form/formDef/view/formDesign/moulds/', // 组件模块 存放文件 *****
      viewMould: 'moulds/', // 组件模块 存放文件 *****
      selectorBtn: '.selectorBtn'
    };
    var temQuery = new propsHandle();  // 实例化模板功能部分
    temQuery.initTem({
      selectorBtn: defProps.selectorBtn,
      selectorTemPath: setter.views + defProps.viewMould
    });

    var dateTimeFiledLen = $(".dateTimeFiled");
    for (var i = 0; i < dateTimeFiledLen.length; i++) {
      laydate.render({
        elem: dateTimeFiledLen[i] //指定元素
        , type: 'date'
        , trigger: 'click'
      });
    }
    //关闭当前页面
    //关闭当前页面
    $("#closeWindow,.closeWindow").click(function () {
      window.location.href ='${ctx}/qbdms/wQbdProblemHandle/view/list';
    });

    var runId = "${runId}";
    if (runId == null || runId == '') {
      $("#hideAndShow").show();
    }

    var common = layui.common;
    common.updateForm({
      name: 'wQbdProblemHandleDataForm',
      idValue: "${id}",
      primary: "id",
      getCallback: function (data) {
        $("#tbxx").html("<td class='qbdms-zeroTable-lable'>填报信息:</td><td colspan='5' class=''>【" + data.data.filldept + " | " + data.data.fillman + " | " + data.data.filldate + "】</td>");

        // $("#tbxx").html("<span class='qbdms-TBinformation'>填报信息:</span><span class='qbdms-TBinformationText'>【" + data.data.filldept + " | " + data.data.fillman + " | " + data.data.filldate + "】</span>");
        $("input[name='dutyperson']").attr("ids", data.data.dutypersonid);

        //-修改页面 初始化附件组件 开始 ------------------------------------------
        $('.uploadFileList').each(function () {
          var fileUploadName = $(this).attr("fileUploadName");
          var jsonFile = data.data[fileUploadName];
          var files = eval(jsonFile);

          if (files) {
            for (var i = 0; i < files.length; i++) {
              var fileLevel = files[i].fileLevel;
              var fileLevelText = files[i].fileLevelText;
              var fileSec = '<div class="fileSecLevel fileSecXg layui-input-inline">' + '<@secSelect.sec_select data_src=1 hasBlank=false/>' + "</div>";
              var newStr = '<span class="file-id" style="margin-right: 20px;" fileId=' + files[i].fileId + ' fileLevelText="' + fileLevelText + '">' + fileSec + '<span class="file-name" title="点击下载文件" onclick="downFile(this)"><i class="iconfont" style="margin-right: 5px"></i>' + files[i].fileName + '</span></span>';
              $(this).html(newStr);
              $(this).find("select:last").val(fileLevel);
              $(this).find("select:last").attr("disabled", "disabled");
            }
          } else {
            $(this).html("<span style='color: #c0c4cc'>未上传</span>");
          }
        });
        //-修改页面 初始化附件组件 结束 ------------------------------------------
      }
    });

    //下载附件
    window.downFile = function (obj) {
      var fileId = $(obj).parents("span").attr("fileId");
      window.location.href = serverPath.qbdmsPath + setter.extendLinkPath + "attachFile/download?fileId=" + fileId;
    }

    publicMethods.bottomFixd()
    $("body *").not("#closeWindow").attr("disabled", "disabled");
    $(".uploadFileCont .qbdms-fileUp,.uploadFileCont i,.addFormTr1").hide();
    $(".uploadFileCont").each(function () {
      if ($(this).children('.uploadFileList').children().length == 0) {
        $(this).children('.uploadFileList').append("<span style='color: #C0C4CC'>未上传</span>")
      }
    })



    var flag="${flag}";
    var procInstId = "${processRun.procInstId}";
    var runId = "${runId}";
    if (runId == null || runId == '') {
      $("#hideAndShow").show();
    }

    //运行明细
    $("#detail").click(function () {
      layer.open({
        type: 2,
        title: "运行明细",
        area: ['80%', '80%'],
        btn: ['关闭'],
        skin: 'btn-close',
        btnAlign: 'c',
        content: serverPath.qbdmsPath +'/workflow/processRun/view/detail?runId=' + runId
      });
    });

    //审批历史
    $("#taskOpinion").click(function () {
      parent.layer.open({
        type: 2,
        title: "审批历史",
        area: ['950px', '585px'],
        content: serverPath.qbdmsPath +"/workflow/taskOpinion/view/list?runId=" + runId
      })
    });

    //流程图
    $(".flowChart").click(function () {
      parent.layer.open({
        type: 2,
        title: "流程图",
        shade: 0.3,
        left: 200,
        area: ['1000px', '600px'],
        content: serverPath.qbdmsPath +"/workflow/processRun/view/bpmImg?procInstId="+procInstId+"&runId="+runId,
        btn:['','关闭'],
        success:function (layero,index) {
          $(layero).find("a.layui-layer-btn0").hide();
        }
      });
    });

  });
</script>
</body>
</html>